<?php
// rsgallery2 api for calendar
defined( '_JEXEC' ) or die();

class calendar_api{


}//end calendar_api

class calendar_rsg2_api{

	function calendar_rsg2_api(){
		$file = JPATH_SITE.DS
		.'administrator/components/com_rsgallery2/init.rsgallery2.php';
		if (file_exists( $file )) {
			require_once( $file );
		}//end if file_exists
		
	}//end constructor calendar_rsg2_api
	
	function instance($newInstance = '',$showTemplate = true){
		$var = rsgInstance::instance($newInstance,$showTemplate);
		return $var;
	}
	
	/**
	* function for storing gallery ids in params
	*  will also parse the params and return
	*/
	function calendarGalleriesStore($assoc_gallery_id = '' , $switch = '', $type = ''){
		switch($switch){
		
			case '1': //parse inbound gallery id str.  ex: "20:myTemplate,12:defaultTemplate,6,5" four galleries, two with templates defined
				if($type == 'array'){
					$items = explode(',',$assoc_gallery_id);
					foreach($items as $index=>$item){
						$value = explode(':',$item);
						$output[ $value[0] ] = $value[1];
					}
				}else{
					/**
					* TODO: code str output; why?
					*/
				}//end if $type
				return $output;
				break;
			case '0':
			default:
				//prepare ids to store
				/**
				* TODO: code storing ids for params ini
				*  should work in concert with other api dynamic params/xml/functions
				*/
		}//end switch
	}//end calendarGalleries
	
}//end calendar_rsg2_api

?>
